Slider=->
    @element = '.action-slider'
    @btnPrev = $(@element).find('.btn-prev')
    @btnNext = $(@element).find('.btn-next')
    @page = 1
    @num
    @init()
    return
Slider.prototype =
    init:->
        that = this
        $(that.element).each ->
            self = $(this)
            that.num = self.find('li').length
            self.find('ul').css({"width":that.num*100+"%"})
            self.find('li').css({"width":100/that.num+"%"})
            return
        that.btnNext.on "click":->
            self = $(this)
            that._next(self.siblings().find("ul"))
            return
        that.btnPrev.on "click":->
            self = $(this)
            that._prev(self.siblings().find("ul"))
            return
        return
    _next:(obj,callback)->
        if this.page < this.num
            obj.animate {"left":-100*this.page+"%"},'slow','swing',->
                callback
                return
            this.page++
        return
    _prev:(obj,callback)->
        if this.page > 1
            this.page = this.page-1
            obj.animate {"left":-100*(this.page-1)+"%"},'slow','swing',->
                callback
                return
            console.log(this.page)
        return        
new Slider